﻿using System;

using NUnit.Framework;
using Spring.Testing.NUnit;
using VisualAgile.Model;
using VisualAgile.IBLL;

namespace VisualAgile.UnitTest
{
    [TestFixture]
    public  class TaskManagerTest :AbstractTransactionalDbProviderSpringContextTests
    {
        protected override string[] ConfigLocations
        {
            get
            {
                return new String[] { "objects.xml" };
            }
        }

        protected ITaskManager TaskManager
        {
            get
            {
                return applicationContext.GetObject("TaskManagerTrans") as ITaskManager;
            }
        }

        [Test]
        public void SaveTaskTest()
        {
            Task task = TaskManager.NewTask();                        
            task.Name = "simple task";
            task.Target = DateTime.Now;

            TaskManager.Save(task);
            transactionManager.Commit(transactionStatus);
        }
    }
}
